<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>列表渲染</title>
    <script src="lib/vue.js"></script>
</head>

<body>
    <div id="box">
        //数组遍历
        <ul>
            <li v-for="(data,index) in datalist" :key="data">{{data}}--{{index}}</li>
        </ul>
        //对象遍历
        <ul>
            <li v-for="(item,key) in obj" :key="item.name">{{item}}--{{key}}</li>
        </ul>
    </div>

    <script>
        new Vue({
            el: "#box",
            data: {
                datalist: ["1111", "2222", "3333"],
                obj: {
                    name: "jiabo",
                    age: "30",
                    location: "xi'an"
                }
            }
        })
    </script>

</body>

</html>